/*
 * @Author       : ljkt
 * @Version      : 1.0
 * @Date         : 2021-10-08 09:29:52
 * @LastEditors: ljkt
 * @LastEditTime: 2024-11-09 21:30:51
 * @Description  :
 */

#include "App_Include.h"

s_flash_t gApp_Flash;

void App_Flash_Init(void)
{
	my_memclr_00(&gApp_Flash, sizeof(gApp_Flash));
	Drv_Flash_Read();
}

void App_Flash_Scan(void)
{

	static u16_t tick = 0;
	if (!Drv_Flash_Is_Write_Cmd())
	{
		tick = Drv_Get_Tick_u16();
	}
	if (Drv_Autoload_Ntick_u16(&tick, 5000ul))
	{
		Drv_Flash_Clr_Cmd();
		Drv_Flash_Write();
	}
}